import "pkl:test"

class Person {
  name: String
  age: Int
}

typealias Email = String

res1 = new PropertiesRenderer {}.renderValue(123)
res2 = new PropertiesRenderer {}.renderValue(1.23)
res3 = new PropertiesRenderer {}.renderValue(false)
res4 = new PropertiesRenderer {}.renderValue("pigeon")
res5 = new PropertiesRenderer {}.renderValue(null)

res6 = test.catch(() -> new PropertiesRenderer {}.renderValue(1.min))
res7 = test.catch(() -> new PropertiesRenderer {}.renderValue(1.mb))
res8 = test.catch(() -> new PropertiesRenderer {}.renderValue(List("pigeon", "parrot")))
res9 = test.catch(() -> new PropertiesRenderer {}.renderValue(Set("pigeon", "parrot")))
res10 = test.catch(() -> new PropertiesRenderer {}.renderValue(Map("name", "pigeon", "age", 42)))
res11 = test.catch(() -> new PropertiesRenderer {}.renderValue(new Listing { "pigeon"; "parrot" }))
res12 = test.catch(() -> new PropertiesRenderer {}.renderValue(new Mapping { ["name"] = "pigeon"; ["age"] = 42 }))
res13 = test.catch(() -> new PropertiesRenderer {}.renderValue(new Dynamic { name = "pigeon"; age = 42 }))
res14 = test.catch(() -> new PropertiesRenderer {}.renderValue(new Person { name = "pigeon"; age = 42 }))
res15 = test.catch(() -> new PropertiesRenderer {}.renderValue(Pair(1, 2)))
res16 = test.catch(() -> new PropertiesRenderer {}.renderValue(Person))
res17 = test.catch(() -> new PropertiesRenderer {}.renderValue(Email))
res18 = test.catch(() -> new PropertiesRenderer {}.renderValue((x) -> x))
res19 = test.catch(() -> new PropertiesRenderer { converters { [Int] = (_) -> throw("ouch") } }.renderValue(42))
res20 = test.catch(() -> new PropertiesRenderer {}.renderValue(IntSeq(1, 4)))
